<extend name='Public:layout' />
<block name='main-content'>	
<div class="daohang">
	<ul>
		<li><button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 首页 </li>
		<li><button type="button" class="am-btn am-btn-default am-radius am-btn-xs">友情链接添加<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a></button></li>
	</ul>
</div>
<div class="admin-biaogelist">
	<div class="listbiaoti am-cf">
		<ul class="am-icon-user on"> 友情链接添加</ul>
		<dl class="am-icon-home" style="float: right;"> 当前位置： 首页 > <a href="#">友情链接添加</a></dl>
	</div>
	<div class="fbneirong">
		<form class="am-form" action="__ACTION__" method="post">
			<div class="am-form-group am-cf">
			  <div class="zuo">友情链接名称：</div>
			  <div class="you">
			    <input type="text" name="linkname" id="linkname" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="" style="width:300px;"><span id="msg"></span>
			  </div>
			</div>
			<div class="am-form-group am-cf">
			  <div class="zuo">友情链接：</div>
			  <div class="you">
			    <input type="text" name="links" id="links" class="am-input-sm" id="doc" placeholder="" style="width:300px;" style="float:left;"><span id="msg" style="display:block;"></span>
			  </div>
			</div>
			<div class="am-form-group am-cf">
			  <div class="you" style="margin-left: 11%;">
			      <input type="submit" class="am-btn am-btn-success am-radius" name="sub" value="添加">&nbsp; &nbsp; <input type="reset" class="am-btn am-btn-secondary am-radius" value="重置">

			  </div>
			</div>
		</form>
	</div>
</div>
<script>
$('#linkname').blur(function(){
	var name=$('#linkname').val();
// alert(name);
 	if(name.length==0){
 		$('#msg').css('color','red');
 		$('#msg').html('友情链接名称不能为空！');
 	}else{
 		$.get('__PUBLIC__/Admins/check.php',{u:name},function(data){
 			// alert(data);
 			if(data==1){
 				$('#msg').css('color','green');
 				$('#msg').html('√');
 			}else{
 				$('#msg').css('color','red');
 				$('#msg').html('此链接已存在');
 			}

 		});
 	}

})

</script>


</block>